package unit4.part9;

public class ExtendsTest {
    public static void main(String[] args) {
        Son son = new Son();
        son.a = 1;
        Son.b = 2;
        System.out.println(son.a);
        System.out.println(Son.b);
        System.out.println(son.d);
        System.out.println(son.methodA());
        System.out.println(Son.methodB());
    }
}

class Super {
    int a;
    static int b;
    private int c;// 因为是private，所以不能继承
    int d = 10;// 带初始化的变量

    int methodA() {
        return a;
    }

    static int methodB() {
        return b;
    }
}

class Son extends Super {
    int d = 100;// 隐藏父类初始化值
}
